package com.zhangxiaofanfan.hotcode.first;

/**
 *
 * @date 2024-07-13 03:14:13
 * @author zhangxiaofanfan
 */
public class HotCode087 {
    public static void main(String[] args) {
        HotCode087 hotCode = new HotCode087();
        int[] nums = {7,7,7,7,7,7,7};
        System.out.println(hotCode.lengthOfLIS(nums));
    }

    public int lengthOfLIS(int[] nums) {
        int[] dp = new int[nums.length];
        dp[0] = 1;
        int maxLength = 1;
        for (int i = 1; i < nums.length; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[j] < nums[i]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            dp[i] = Math.max(1, dp[i]);
            maxLength = Math.max(maxLength, dp[i]);
        }
        return maxLength;
    }
}